package com.itobase.statusDetect.Model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;


import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
 * @author htyu
 * @date 2019/2/23
 */

@Document
@Data
public class Teaching {
    @Id
    private String id;

    /**
     *教学班绑定的课程id
     */
    private String courseID;

    /**
     *教学班绑定的老师id
     */
    private String teacherID;

    /**
     *教学班绑定的教室id
     */
    private String classroomID;

    /**
     *教学班绑定的时间id
     */
    private String timeID;

    /**
     * 教学班起始周
     */
    private String startWeek;

    /**
     * 教学班结束周
     */
    private String endWeek;

    /**
     * 教学班上课时间
     */
    private String schoolTime;

    /**
     *教学班学生列表
     */
    private List<User> list = Collections.emptyList();

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Teaching teaching = (Teaching) o;
        return Objects.equals(courseID, teaching.courseID) &&
                Objects.equals(teacherID, teaching.teacherID) &&
                Objects.equals(classroomID, teaching.classroomID) &&
                Objects.equals(timeID, teaching.timeID) &&
                Objects.equals(startWeek, teaching.startWeek) &&
                Objects.equals(endWeek, teaching.endWeek) &&
                Objects.equals(schoolTime, teaching.schoolTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(courseID, teacherID, classroomID, timeID, startWeek, endWeek, schoolTime);
    }
}
